package admin

import (
	"xwaf_admin/xadmin/src/rbac"

	beego "github.com/beego/beego/v2/server/web"
)

func router() {
	//beego.Router("/", &rbac.MainController{}, "*:Index")
	beego.Router("/index", &rbac.MainController{}, "*:Index") //后台首页
	beego.Router("/public/login", &rbac.MainController{}, "*:Login")
	beego.Router("/public/logout", &rbac.MainController{}, "*:Logout")
	beego.Router("/public/changepwd", &rbac.MainController{}, "*:Changepwd")
	beego.Router("/public/myinfo", &rbac.MainController{}, "*:MyInfo")

	beego.Router("/rbac/user/Add", &rbac.UserController{}, "*:Add")
	beego.Router("/rbac/user/Update", &rbac.UserController{}, "*:Update")
	beego.Router("/rbac/user/Delete", &rbac.UserController{}, "*:Delete")
	beego.Router("/rbac/user/List", &rbac.UserController{}, "*:List")
	//beego.Router("/public/user/GetuList", &rbac.UserController{}, "*:GetuList")

	//beego.Router("/rbac/node/AddEdit", &rbac.NodeController{}, "*:AddEdit")
	beego.Router("/rbac/node/Add", &rbac.NodeController{}, "*:Add")
	beego.Router("/rbac/node/Edit", &rbac.NodeController{}, "*:Edit")
	beego.Router("/rbac/node/Delete", &rbac.NodeController{}, "*:Delete")
	beego.Router("/rbac/node/List", &rbac.NodeController{}, "*:List")
	beego.Router("/rbac/node/Getlist", &rbac.NodeController{}, "*:Getlist")
	beego.Router("/rbac/node/GetPid", &rbac.NodeController{}, "*:GetPid")

	//集群授权
	beego.Router("/rbac/cluster/Delete", &rbac.ClusterController{}, "*:Delete")
	beego.Router("/rbac/cluster/List", &rbac.ClusterController{}, "*:List")
	beego.Router("/rbac/cluster/Add", &rbac.ClusterController{}, "*:Add")

	beego.Router("/rbac/group/Add", &rbac.GroupController{}, "*:Add")
	beego.Router("/rbac/group/Update", &rbac.GroupController{}, "*:Update")
	beego.Router("/rbac/group/Delete", &rbac.GroupController{}, "*:Delete")
	beego.Router("/rbac/group/List", &rbac.GroupController{}, "*:List")

	beego.Router("/rbac/role/AddAndEdit", &rbac.RoleController{}, "*:AddAndEdit")
	beego.Router("/rbac/role/Delete", &rbac.RoleController{}, "*:Delete")
	beego.Router("/rbac/role/AddAccess", &rbac.RoleController{}, "*:AddAccess")
	beego.Router("/rbac/role/RoleToUserList", &rbac.RoleController{}, "*:RoleToUserList")
	beego.Router("/rbac/role/RoleToNodeList", &rbac.RoleController{}, "*:RoleToNodeList")
	beego.Router("/rbac/role/AddRoleToUser", &rbac.RoleController{}, "*:AddRoleToUser")
	beego.Router("/rbac/role/DelRoleToUser", &rbac.RoleController{}, "*:DelRoleToUser")
	beego.Router("/rbac/role/DelRoleToNode", &rbac.RoleController{}, "*:DelRoleToNode")
	beego.Router("/rbac/role/Getlist", &rbac.RoleController{}, "*:Getlist")
	beego.Router("/rbac/role/GetridByuid", &rbac.RoleController{}, "*:GetRoleidByUserId")
	beego.Router("/rbac/role/List", &rbac.RoleController{}, "*:List")
	//beego.Router("/rbac/role/AccessToNode", &rbac.RoleController{}, "*:AccessToNode") //未用到
}
